<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //.then.then链式调用
        let pro = new Promise(function (resolve, reject) {
            //执行器函数
            setTimeout(() => {
                resolve(1000)
                //reject("天天迟到，没有奖金!")
            }, 1000)
        })
        pro.then((res) => {
            console.log("奖金1", res)
            //如果return 非promise类型，pending->fulfilled
            //如果return promise类型，那就根据这个新的promise对象的结果，
            //来决定pending->fulfilled 还是 pending->rejected
            return res
        }).then((res) => {
            console.log("奖金2", res)
        }).catch((err) => {
            console.log("啥也没有", res)
        })
    </script>
</body>

</html>